package delasell.adressBook.controler;


import delasell.adressBook.model.*;
import delasell.adressBook.view.*;

public class AdressBook {
	
		static public ContactList cList;
		static public MainFrame mainWindow;
		static public CreationWindow newContact;

	public static void main(String[] args) {		
		
		cList = new ContactList();
		mainWindow = new MainFrame();
		newContact = new CreationWindow();
		Listener listener = new Listener();
		
		setListening(mainWindow, listener);
		mainWindow.setVisible(true);
		newContact.setVisible(false);
		

	}

	private static void setListening(MainFrame mainWindow, Listener listener) {
		
		MainFrame.getNewButton().addActionListener(listener);
		MainFrame.getSaveButton().addActionListener(listener);
		MainFrame.getEditButton().addActionListener(listener);
		MainFrame.getDeleteButton().addActionListener(listener);
		MainFrame.getOpenButton().addActionListener(listener);
		
		CreationWindow.getSaveButton().addActionListener(listener);
		CreationWindow.getCancelButton().addActionListener(listener);
		
		
		
		
	}

}
